/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * <p>Project: app2022 - D2
 * <p>Powered by webrx On 2022-01-05 15:41:17
 *
* @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class D2 {
    public static void main(String[] args) {
        int y = 2022;
        int m = 1;
        int d = 5;
        var c = Calendar.getInstance();
        c.set(Calendar.YEAR, y);
        c.set(Calendar.MONTH, m < 1 ? 0 : m <= 12 ? m - 1 : 11);
        c.set(Calendar.DATE, d);
        //System.out.printf("%tF%n", c);

        c.set(Calendar.MINUTE, 3);

        //yyyy - MM - dd HH mm ss S毫秒 E周三 a上下行  m分钟不补0
        //k 24小时 16时 K 12小时 4时 D 是一年中第几天 F 一年中第几个星期
        //z 代表 CST
        SimpleDateFormat sdf = new SimpleDateFormat("z D F w W k K  yyyy-MM-dd HH:mm:ss S E a m");
        System.out.println(sdf.format(c.getTime()));

        var s2 = new SimpleDateFormat("MM月dd日");
        System.out.println(s2.format(new Date()));

        //格式年月日 时分秒 星期几
    }
}
